<?php

class user_module {

	//display the user controls
	public static function userControls()
	{
		
		if($user = user::IsLoggedIn())
		{
			//user is logged in, display user controls
			return '<p>Welcome,  ' . $user->name . '</p>
					<p><a href="' . ROOT_URL . URL_BASE . 'user/edit">Edit</a> | <a href="' . ROOT_URL . URL_BASE . 'user/logout">Logout</a></p>';
		}
		else
		{
			//user is not logged in display login/register stuff
			return '<p>Welcome, Guest</p>
					<p><a href="' . ROOT_URL . URL_BASE . 'user/login">Login</a> | <a href="' . ROOT_URL . URL_BASE . 'user/register">Register</a></p>';
		}
	}

}
?>